<template>
  <div class="container">
    <data-view
      propViewKey="cfg_parameter"
      propViewForm="cfg/parameter/detail.vue"
      @extra-button-click="extraButtonClick"
      :propHidePageSearch="false"
      :propIsTdesign="true"
    />
  </div>
</template>

<script>
export default {
  name: 'parameter',
  data() {
    return {}
  },
  components: {},
  methods: {
    extraButtonClick({ button, data, index }) {
      let buttonKey = button.key
      let ids = data.map((row) => row.id)

      if (buttonKey === 'refreshCache') {
        this.refreshCache()
      }
    },
    refreshCache(data) {
      this.$ajax.post('/cfg/parameter/refreshCache').then((resp) => {
        this.utilMessage.success(resp.msg)
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.container {
  height: 100%;
  background-color: #fff;
}
</style>
